package com.ruoyi.web.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.web.domain.ReservationRecord;
import com.ruoyi.web.mapper.ReservationRecordMapper;
import com.ruoyi.web.service.IReservationRecordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.common.core.text.Convert;

/**
 * 预约Service业务层处理
 * 
 * @author ruoyi
 * @date 2023-11-02
 */
@Service
public class ReservationRecordServiceImpl implements IReservationRecordService
{
    @Autowired
    private ReservationRecordMapper reservationRecordMapper;

    /**
     * 查询预约
     * 
     * @param id 预约主键
     * @return 预约
     */
    @Override
    public ReservationRecord selectReservationRecordById(Long id)
    {
        return reservationRecordMapper.selectReservationRecordById(id);
    }

    /**
     * 查询预约列表
     * 
     * @param reservationRecord 预约
     * @return 预约
     */
    @Override
    public List<ReservationRecord> selectReservationRecordList(ReservationRecord reservationRecord)
    {
        return reservationRecordMapper.selectReservationRecordList(reservationRecord);
    }

    /**
     * 新增预约
     * 
     * @param reservationRecord 预约
     * @return 结果
     */
    @Override
    public int insertReservationRecord(ReservationRecord reservationRecord)
    {
        reservationRecord.setCreateTime(DateUtils.getNowDate());
        return reservationRecordMapper.insertReservationRecord(reservationRecord);
    }

    /**
     * 修改预约
     * 
     * @param reservationRecord 预约
     * @return 结果
     */
    @Override
    public int updateReservationRecord(ReservationRecord reservationRecord)
    {
        reservationRecord.setUpdateTime(DateUtils.getNowDate());
        return reservationRecordMapper.updateReservationRecord(reservationRecord);
    }

    /**
     * 批量删除预约
     * 
     * @param ids 需要删除的预约主键
     * @return 结果
     */
    @Override
    public int deleteReservationRecordByIds(String ids)
    {
        return reservationRecordMapper.deleteReservationRecordByIds(Convert.toStrArray(ids));
    }

    /**
     * 删除预约信息
     * 
     * @param id 预约主键
     * @return 结果
     */
    @Override
    public int deleteReservationRecordById(Long id)
    {
        return reservationRecordMapper.deleteReservationRecordById(id);
    }
}
